﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LispInterpretor;

namespace UnitTests
{
    [TestClass]
    public class TestNot
    {
        [TestMethod]
        [ExpectedException(typeof(InvalidProgramException))]
        public void TestNotWithTooManyArguments()
        {
            Evaluator.Eval("(not True False)");
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidProgramException))]
        public void TestNotWithTooFewArguments()
        {
            Evaluator.Eval("(not)");
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidProgramException))]
        public void TestNotWithInvalidArgument()
        {
            Evaluator.Eval("(not 1)");
        }

        [TestMethod]
        public void TestNotWithTrueArgument()
        {
            Assert.AreEqual(false, Evaluator.Eval("(not True)"));
        }

        [TestMethod]
        public void TestNotWithFalseArgument()
        {
            Assert.AreEqual(true, Evaluator.Eval("(not False)"));
        }
    }
}
